/*
 * @Author: nns4
 * @Date: 2019-12-16 13:54:47
 * @LastEditors  : nns4
 * @FilePath: /WXSHOP/wxShop/src/libs/util.js
 * @Description: 公共方法
 */
export const getRouterStatus = (routers) => {
    //获取隐藏地导航 和返回顶部页面名称
    let hideNavs = [];
    let hideBackTops = [];
    let pageCache = []
    find(routers)

    function find(r) {
        r.forEach(function (node) {
            if (node.meta.hideNav) {
                hideNavs.push(node.name);
            }
            if (node.meta.hideBackTop) {
                hideBackTops.push(node.name);
            }

            if (node.meta.pageCache) {
                pageCache.push(node.name);
            }
            if (node.children) {
                find(node.children)
            }

        });
    }
    return {
        hideNavs,
        hideBackTops,
        pageCache
    };
}